﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DelegatePractise.one
{
    internal class InterfaceLogger101
    {
    }

    public interface ILogger
    {
        void Log(string message);
    }

    public class FileLogger : ILogger
    {
        // 写入文件
        public void Log(string message) {}
    }

    // 依赖接口，而非具体实现
    public class Service
    {
        private readonly ILogger _logger;
        public Service(ILogger logger) => _logger = logger;
    }
}
